import { requestClient } from '#/api/request';

export interface UserItem {
  id: string;
  username: string;
  nickname: string;
  email?: string;
  phone?: string;
  avatar?: string;
  status: string;
  dept_id?: string;
  dept_name?: string;
  role_ids?: string[];
  role_names?: string[];
  created_time?: string;
  updated_time?: string;
}

export interface UserListParams {
  page?: number;
  page_size?: number;
  username?: string;
  nickname?: string;
  status?: string;
  dept_id?: string;
}

export interface UserListResult {
  items: UserItem[];
  total: number;
  page: number;
  page_size: number;
}

/**
 * 获取用户列表
 */
export const getUserList = (params?: UserListParams): Promise<UserListResult> => {
  return requestClient.get('/system/users/', { params });
};